<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>

<form id="form_comentario" action="<?php echo url_for('comentario/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id_comentario='.$form->getObject()->getIdComentario() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<input type="hidden" name="id_comentario" value="<?php echo $form->getObject()->getIdComentario() ?>" />
<?php endif; ?>
	<?php echo $form->renderHiddenFields() ?>
  <table class="form">
    <tbody>
      <tr><th colspan="2" class="title">Dados comentario</th></tr>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['descricao']->renderLabel() ?></th>
        <td>
          <?php echo $form['descricao'] ?>
          <?php echo form_error('comentario[descricao]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['data_comentario']->renderLabel() ?></th>
        <td>
          <?php echo $form['data_comentario'] ?>
          <?php echo form_error('comentario[data_comentario]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['status']->renderLabel() ?></th>
        <td>
          <?php echo $form['status'] ?>
          <?php echo form_error('comentario[status]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['id_midia']->renderLabel() ?></th>
        <td>
          <?php echo $form['id_midia'] ?>
          <?php echo form_error('comentario[id_midia]'); ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['id_evento']->renderLabel() ?></th>
        <td>
          <?php echo $form['id_evento'] ?>
          <?php echo form_error('comentario[id_evento]'); ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>

<?php
	comandos_form(
		link_to(
			':: Voltar ::',
			'comentario/list',
			array('class' => 'botao')
		),
		button_to_function(
			':: Salvar ::',
			"$('#form_comentario').submit()",
			array('class' => 'botao')
		)
	);
?>